﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace LowLevelGraphics
{
    /// <summary>
    /// 
    /// </summary>
    public class ColorBlobExtractorDirection
    {
        int nXDir = 0;
        int nYDir = 0;

        List<Size> aDir = new List<Size>();

        private int nIndex = 0;

        /// <summary>
        /// Gets the current direction.
        /// </summary>
        /// <value>The current direction.</value>
        public Size CurrentDirection
        {
            get{ return aDir[nIndex]; }
        }

        /// <summary>
        /// Initializes a new instance of the ColorBlobExtractorDirection class.
        /// </summary>
        public ColorBlobExtractorDirection()
        {
            aDir.Add(new Size(1, 0)); //right
            aDir.Add(new Size(0, 1)); //down
            aDir.Add(new Size(-1, 0)); //left
            aDir.Add(new Size(0, -1)); //up
        }

        /// <summary>
        /// Cycles the direction.
        /// </summary>
        public void CycleDir()
        {
            nIndex++;
            nIndex %= aDir.Count;
        }

        /// <summary>
        /// Gets the count.
        /// </summary>
        /// <value>The count.</value>
        public int Count
        {
            get { return aDir.Count; }
        }
    }
}
